using NUnit.Framework;

using StructureMap.TypeMockAutoMockerTesting;

namespace StructureMap.TypeMockAutoMocker
{
	[TestFixture]
	public class ClassicAutoMockerWithAbstractClassUnderTestTester: ClassiAutoMockerTesterBase<AbstractCutWithAbstractMock, AbstractCutWithConcreteMock>
	{
		[Test]
		public void CanCallAbstractMethodsOnAbstractPartialMock()
		{
			// var mock = Isolate.Fake.Instance<AbstractCutWithConcreteMock>(Members.CallOriginal);
			var autoMocker = createAutoMockerWithConcreteMock();
			autoMocker.PartialMockTheClassUnderTest();
			Assert.AreEqual(0, autoMocker.ClassUnderTest.Get8(), "the abstract method should return a default value");
		}
		[Test]
		public void CanCallConcreteMethodsOnAbstractPartialMock()
		{
			// var mock = Isolate.Fake.Instance<AbstractCutWithConcreteMock>(Members.CallOriginal);
			var autoMocker = createAutoMockerWithConcreteMock();
			autoMocker.PartialMockTheClassUnderTest();
			Assert.AreEqual(9, autoMocker.ClassUnderTest.Get9(), "the concrete method should return the value of its original implementation (because it's a partial mock)");
		}
		[Test]
		public void CanCallConcreteMethodsOnAbstractFullMock()
		{
			// var mock = Isolate.Fake.Instance<AbstractCutWithConcreteMock>(Members.CallOriginal);
			var autoMocker = createAutoMockerWithConcreteMock();
			Assert.AreEqual(0, autoMocker.ClassUnderTest.Get8(), "the abstract method should return a default value");
		}
		[Test]
		public void CanCallAbstractMethodsOnAbstractFullMock()
		{
			// var mock = Isolate.Fake.Instance<AbstractCutWithConcreteMock>(Members.CallOriginal);
			var autoMocker = createAutoMockerWithConcreteMock();
			Assert.AreEqual(0, autoMocker.ClassUnderTest.Get9(), "the concrete method should return a default value (because it's not a partial mock)");
		}
	}
}